package myvideos;

import myvideos.model.TodoMockModel;
import myvideos.provider.TodoContentProvider;
import myvideos.provider.TodoLabelProvider;

import org.eclipse.jface.viewers.TreeViewer;  
import org.eclipse.swt.SWT;  
import org.eclipse.swt.widgets.Composite;  
import org.eclipse.ui.part.ViewPart; 

public class FileExplorer extends ViewPart {
	
	public static final String ID = "MyVideos.view";
	private TreeViewer viewer;  
	
	public FileExplorer() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public void createPartControl(Composite parent) {
		viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL  | SWT.V_SCROLL);  
        viewer.setContentProvider(new TodoContentProvider());  
        viewer.setLabelProvider(new TodoLabelProvider());  
        // Expand the tree   
        viewer.setAutoExpandLevel(1);  
        // Provide the input to the ContentProvider  
        viewer.setInput(new TodoMockModel());
	}

	@Override
	public void setFocus() {
		viewer.getControl().setFocus();

	}

}
